<div class="pa -top pa-bottom">
  <div class="clearfix">
    <h2 class="left">菜单</h2>
    <div class="left">
      <%= render 'products/sidebar' %>
    </div>
  </div>
  <hr/>
  <div class="clearfix">
    <div>
      <% @products.each_with_index do |product,index| %>
        <div class="product-item shadow2">
          <div class="center avatar">
            <%= image_tag product.avatar.url(:big) %>
          </div>
          <div>
            <div class="f14 lh36"><%= link_to product.name, "/products/show/#{product.id}", :target => '_blank' %></div>
            <div class="clearfix">
              <ul class="left product-des">
                <li>价格 <del class="c999"><%= product.price+2 %></del> <span class="product-price"><%= product.price %></span> 元</li>
                <li>剩余 <span ><%= product.stock %></span> 份</li>
              </ul>
              <div class="right pa-top-3">
                <% if product.stock>0 %>
                  <%= link_to image_tag('order.jpg'), "/carts/add/#{product.id}", :class => 'tdn' %>
                <% else %>
                  <%= image_tag 'order-disabled.jpg' %>
                <% end %>
              </div>
            </div>
          </div>
        </div>
      <% end %>
      <div class="center">
        <%= will_paginate @products %>
      </div>
    </div>
  </div>
</div>